/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * InfoPopUp.java
 *
 * Created on 19-giu-2009, 1.29.41
 */

package freimapgsoc;



/**
 *
 * @author stefano
 */
public class InfoPopUpSelect extends javax.swing.JFrame {

    /** Creates new form InfoPopUp */
    public InfoPopUpSelect(String msg1, String msg2) {
        initComponents();
        this.setLocationRelativeTo(this);
        msgLabel.setText(msg1);
        msgLabel2.setText(msg2);
        CheckActiveDataSource check = new CheckActiveDataSource();
        if(check.check_mysql()==true){
            enableMySqlBut();
        }
        if(check.check_nameservice()==true){
            enableNameServiceBut();
        }
        if(check.check_olsr()==true){
            enableOlsrBut();
        }
    }

    public void enableMySqlBut(){
            mySqlButton.setEnabled(true);
            //new DataSource(id)
            //return DATASOURCE ID
    }

    public void enableNameServiceBut(){
            nameServiceButton.setEnabled(true);
           // LatLonJsDataSource data=null;
           // data.init("var/run/latlon.js");
    }

    public void enableOlsrBut(){
        olsrButton.setEnabled(true);
    }

    /**
	 * This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 * @return 
	 */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        msgLabel = new javax.swing.JLabel();
        msgLabel2 = new javax.swing.JLabel();
        nameServiceButton = new javax.swing.JButton();
        olsrButton = new javax.swing.JButton();
        chooseFileButton = new javax.swing.JButton();
        mySqlButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setAlwaysOnTop(true);
        setName("Form"); // NOI18N
        setResizable(false);

        msgLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        msgLabel.setName("msgLabel"); // NOI18N

        msgLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        msgLabel2.setName("msgLabel2"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance().getContext().getResourceMap(InfoPopUpSelect.class);
        nameServiceButton.setText(resourceMap.getString("nameServiceButton.text")); // NOI18N
        nameServiceButton.setEnabled(false);
        nameServiceButton.setName("nameServiceButton"); // NOI18N

        olsrButton.setText(resourceMap.getString("olsrButton.text")); // NOI18N
        olsrButton.setEnabled(false);
        olsrButton.setName("olsrButton"); // NOI18N

        chooseFileButton.setText(resourceMap.getString("chooseFileButton.text")); // NOI18N
        chooseFileButton.setName("chooseFileButton"); // NOI18N

        mySqlButton.setText(resourceMap.getString("mySqlButton.text")); // NOI18N
        mySqlButton.setEnabled(false);
        mySqlButton.setName("mySqlButton"); // NOI18N
        mySqlButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mySqlButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(msgLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 541, Short.MAX_VALUE)
                            .addComponent(msgLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 541, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(90, 90, 90)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(olsrButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(mySqlButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(nameServiceButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(chooseFileButton, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 108, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(msgLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(msgLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(mySqlButton)
                    .addComponent(nameServiceButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(olsrButton)
                    .addComponent(chooseFileButton))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void mySqlButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mySqlButtonActionPerformed
        //Draw Links from MySql
    }//GEN-LAST:event_mySqlButtonActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton chooseFileButton;
    private javax.swing.JLabel msgLabel;
    private javax.swing.JLabel msgLabel2;
    private javax.swing.JButton mySqlButton;
    private javax.swing.JButton nameServiceButton;
    private javax.swing.JButton olsrButton;
    // End of variables declaration//GEN-END:variables

}
